<?php

namespace app\matter\model;

use think\Model;
use think\model\concern\SoftDelete;

class MatterModel extends Model
{
    protected $table = 'm_matter';
    use SoftDelete;
    protected $deleteTime = 'delete_time';

    //审查要点
    public function points()
    {
        return $this->hasMany(MatterReviewPointsModel::class,  'matter_id');
    }
    //常见问题
    public function question()
    {
        return $this->hasMany(MatterQuestionModel::class,  'matter_id');
    }
    //情形
    public function case()
    {
        return $this->hasMany(MatterCaseModel::class,  'matter_id');
    }
    //所属机构
    public function unit()
    {
        return $this->belongsTo(UnitModel::class,  'unit_id');
    }
    //所属区划
    public function area()
    {
        return $this->belongsTo(AreaModel::class,  'area_id');
    }
    //上级目录
    public function directory()
    {
        return $this->belongsTo(MatterDirectoryModel::class,  'directory_id');
    }

}
